<?php // no direct access
/* 
Module latest news for joomla 1.5
Slice effect by Jquery
Develope by Tranquang
At Vinazoom co., Ltd
website:  www.vinazoom.com
License GNU/GPL
*/
defined('_JEXEC') or die('Restricted access'); ?>

<?php 
	$number = count($list);
	if($number > 0){
?>

<div class="main_lastnews_module<?php echo $params->get('moduleclass_sfx') ?>">
	<div id="main_lastnews_module_top">
        <div class="menucon">
            <div class="menu_itemcon over1 fl">
					<a href="<?php echo $list[0]->linkSec; ?>">
						<span class = 'title_sumary'> <?php if ($module->showtitle != 0) : ?>         
                 		<?php echo $module->title; ?>                    
            		<?php endif; ?></span>
            		</a>
            </div>
        </div>
    </div>
	<div id="main_lastnews_module_mid">
		<table cellpadding="0" cellspacing="0" <?php echo $w_slice?> <?php echo $h_slice?>>
				<tr>
					<?php 
					
					for ($k = 0; $k < 2; $k++){
					$widthTD = '"330px"';
					if ($list[$k]->img){ ?>
					<td width="110px">
						<div class="content_top_img"><a href="<?php echo $list[$k]->link; ?>">
		                            <img src="<?php echo $list[$k]->img; ?>" <?php echo $w_image; ?> <?php echo $h_image; ?> alt="photo" align="left" class="img1"/></a>
		                </div>
					
					</td>
					 <?php 
						$widthTD = '"240px"';
					}
					?>
					<td <?php echo "width = ".$widthTD; ?> >
						<div class="content_top_detail_text">
		                    <a href="<?php echo $list[$k]->link; ?>" class="latestnewstq<?php echo $params->get('moduleclass_sfx'); ?>"><?php echo $list[$k]->text; ?><br /></a>
		                    <p style = "text-transform:lowercase">
		                    <?php
								
		                        $chuoi = strip_tags($list[$k]->intro);
								
		                        $maxleng = strlen($chuoi);
								if($maxChar == 0 || $maxleng < $maxChar){
									$gioihan = $maxleng;
								}else{
									$gioihan = $maxChar;
								}
								if(strpos($chuoi," ",$gioihan) >= $gioihan){
									$new_gioihan=strpos($chuoi," ",$gioihan);
									$new_chuoi = substr($chuoi,0,$new_gioihan)." [...]";
								}else{
									$new_chuoi = $chuoi;
								}
		         
		                        echo  $new_chuoi;
		                    ?>
							</p>
							<p class = 'readmore_sumary'>
								 <a href="<?php echo $list[$k]->link; ?>" ><?php echo JText::sprintf('Read more...');?></a>
								
							</p>
		                </div>
					
					</td>
					<?php if($k = 0){?>
					<td width="20px"></td>
					<?php }?>
					<?php } ?>
				</tr>
				<?php if($number > 2){ ?>
				<tr>
					<td colspan="5">
					<ul class = "link_module">
						<?php 
							for ($i = 2; $i < $number; $i++){
								?>
									<li>
										<a href="<?php echo $list[$i]->link; ?>" class="latestnewstq<?php echo $params->get('moduleclass_sfx'); ?>"><?php echo $list[$i]->text; ?></a>
									</li>
								<?php
							}
						?>
					</ul>
					</td>
				</tr>
				<?php } ?>
			</table>
	</div>
	<div id="main_lastnews_module_bot">
    </div>
</div>
<?php }?>
